package com.sl.water.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.sl.water.entity.PlanECunPerson;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.List;


@Data
public class PlanTransferPersonDTO {

    @JsonProperty("pZbzs")
    @Schema(description = "值班值守人员")
    private String pZbzs;

    @JsonProperty("pCxqxZfz")
    @Schema(description = "查险枪险人员-总负责")
    private String pCxqxZfz;

    @JsonProperty("pCxqxCxzz")
    @Schema(description = "查险组长")
    private String pCxqxCxzz;

    @JsonProperty("pCxqxQxzz")
    @Schema(description = "枪险组长")
    private String pCxqxQxzz;

    @JsonProperty("pJszjzZz")
    @Schema(description = "技术专家组-组长")
    private String pJszjzZz;

    @JsonProperty("pJszjzFzz")
    @Schema(description = "技术专家组-副组长")
    private String pJszjzFzz;

    @JsonProperty("pJszjzJszc")
    @Schema(description = "技术专家组-技术支持")
    private String pJszjzJszc;

    public PlanTransferPersonDTO(List<PlanECunPerson> list) {
        list.forEach(planECunPerson -> {
            String person = planECunPerson.getPerson();
            switch (planECunPerson.getKind()) {
                case "值班值守" -> this.pZbzs = person;
                case "查险枪险总负责" -> this.pCxqxZfz = person;
                case "查险组长" -> this.pCxqxCxzz = person;
                case "抢险组长" -> this.pCxqxQxzz = person;
                case "技术专家组组长" -> this.pJszjzZz = person;
                case "技术专家组副组长" -> this.pJszjzFzz = person;
                case "技术专家组技术支持" -> this.pJszjzJszc = person;
            }
        });
    }
}
